﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace passitumi
{
	/**
		 * IpPingTestEventArgs represents the results of a ping test.
		 */
	public class IpPingTestEventArgs
	{
		// Constants to describe events that occur
		public const string SUCCESS = "Success";
		public const string TIMEOUT = "Timeout";
		public const string ERROR = "Error";

		public string ipAddress;
		public string result;
		public long time;

		/**
		 * Constructor for an IpPingTest event that timed out.
		 */
		public IpPingTestEventArgs(string ipAddress, string pingResult)
		{
			this.ipAddress = ipAddress;

			if (pingResult == IpPingTestEventArgs.TIMEOUT)
			{
				this.result = pingResult;
			}
			else
			{
				this.result = IpPingTestEventArgs.ERROR;
			}
		}

		/**
		 * Constructor for an IpPingTest event that succeeded.
		 */
		public IpPingTestEventArgs(string ipAddress, string result, long time)
		{
			this.ipAddress = ipAddress;
			this.time = time;

			if (result == IpPingTestEventArgs.SUCCESS)
			{
				this.result = result;
			}
			else
			{
				this.result = IpPingTestEventArgs.ERROR;
			}
		}
	}
}
